<?php

namespace catchAdmin\pc\tables;

use catchAdmin\pc\tables\forms\Factory;
use catcher\CatchTable;
use catcher\library\table\Actions;
use catcher\library\table\HeaderItem;
use catcher\library\table\Search;

class AgentBaoMing extends CatchTable
{

    public function Table()
    {
        return $this
            ->getTable('agentBaoMing')
            ->header([
                HeaderItem::label('类型')->prop('type_name'),
                HeaderItem::label('姓名')->prop('realname'),
                HeaderItem::label('手机号')->prop('mobile'),
                HeaderItem::label('操作')
                    ->actions([
                        Actions::update(),
//                        Actions::delete(),
                    ])
                    ->width(260),
            ])
            ->withSearch([
                Search::label('姓名')->text('realname', '姓名')->clearable(true),
                Search::label('手机号')->text('mobile', '手机号')->clearable(true),
                Search::label('类型')
                    ->select('type', '位置', tableSelectArray((new \catchAdmin\model\AgentBaoMing())->getTypeList()))
                    ->style(['width' => '100px'])
                    ->clearable(true),

            ])
            ->selectionChange()
            ->withApiRoute('agentBaoMing')
            ->withActions([
//                Actions::create(),
            ])
            ->render();
    }


    public function form()
    {
        return Factory::create('agentBaoMing');
    }

}
